-
Notifications
You must be signed in to change notification settings - Fork 29
fix: Remove ordering on account organizations list #900
Conversation
…ee activatedUserCount on that account's orgs
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
| and current_user.is_authenticated | ||
| and queried_owner | ||
| and queried_owner.account | ||
| and current_user in queried_owner.account.users.all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 💯 💯
LMK if this is being slow, can optimize with
- a prefetch for the Account and Users objs when you hit the db for the Owner obj
- doing
current_user in queried_owner.account.users.all()in a different way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queried_owner is the OwnerOrg that the current_user is checking permissions for right? Not the current_user's OwnerUser object 🫠
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nora-codecov Yes. Specifically this decorator should allow users to see fields on owners they share an account with. For example, I'm in codecov org and not sentry org. Since we share an Account, this decorator will let me see certain things on Sentry that an unrelated user could not see.
ajay-sentry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
send it!
Removes the ordering argument on the account organizations list because it turns out that the paginator can't handle/isn't intended to do sorting by count of a field. Was throwing errors.
Additionally, adds a new resolver decorator to allow users of an account to see the activatedUserCount of orgs in that same account. This was a necessary change to support the desired UI, otherwise we'd only show activated user counts for orgs that the user is a member of.